package com.lyf.mapper.admin;


import com.github.pagehelper.Page;
import com.lyf.annotation.AutoFill;
import com.lyf.dto.EmployeePageQueryDTO;
import com.lyf.enumeration.OperationType;
import com.lyf.pojo.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 插入员工数据
     * @param employee
     */
    @AutoFill(value = OperationType.INSERT)
    void insert(Employee employee);

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee getByUsername(String username);

    /**
     * 分页查询
     * @param name
     * @return
     */
    Page<Employee> pageQuery(String name);

    /**
     * 修改员工信息
     * @param employee
     * @return
     */
    @AutoFill(value = OperationType.UPDATE)
    void update(Employee employee);

    /**
     * 根据id查询员工
     * @param id
     * @return
     */
    Employee selectById(Long id);
}
